package com.hl;

import com.github.pagehelper.PageHelper;
import com.hl.entity.Teacher;
import com.hl.mapper.TeacherMapper;
import com.hl.util.MybatisUtils;
import org.apache.ibatis.session.SqlSession;

import java.io.IOException;
import java.util.List;
/**
 * 分页测试
 * */
public class Test3Page {
    public static void main(String[] args) throws IOException {
        SqlSession sqlSession = MybatisUtils.getSqlSession();
        TeacherMapper mapper = sqlSession.getMapper(TeacherMapper.class);

        PageHelper.startPage(2,2);
        List<Teacher> teacherList = mapper.selectAllTeachers();
        for (Teacher teacher1 : teacherList) {
            System.out.println(teacher1);
        }
    }
}
